import wx


class MainFrame(wx.Frame):
    def __init__(self, parent, title):
        super(MainFrame, self).__init__(parent, title=title, size=(300, 200))

        # 创建一个面板
        panel = wx.Panel(self)

        # 创建一个按钮
        self.button = wx.Button(panel, label="触发提示音", pos=(100, 50))

        # 绑定按钮点击事件到处理函数
        self.button.Bind(wx.EVT_BUTTON, self.on_button_click)

        # 显示窗口
        self.Show(True)

    def on_button_click(self, event):
        # 触发系统提示音
        wx.Bell()


if __name__ == "__main__":
    app = wx.App(False)
    frame = MainFrame(None, "wx.Bell() 示例")
    app.MainLoop()
